﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;


namespace Pub.Controls
{

    public static class Dlg
    {
        public static Boolean SelMulti(string FormText, string strSQL, string FieldCaption, string FieldWidth, Boolean bAllowEmpty, string strSortOrder, ref string OutCode, ref string OutName)
        {
            Pub.Controls.MastForm.BaseSelect dlgSelMulti = new Pub.Controls.MastForm.BaseSelect();
            dlgSelMulti.FormText = FormText;
            dlgSelMulti.AllowMulti = bAllowEmpty;
            dlgSelMulti.SQL = strSQL;
            dlgSelMulti.FieldCaption = FieldCaption;
            dlgSelMulti.FieldWidth = FieldWidth;
            dlgSelMulti.SortOrder = strSortOrder;

            Boolean bl = (dlgSelMulti.ShowDialog() == DialogResult.OK);
            OutCode = dlgSelMulti.ResultCode;
            OutName = dlgSelMulti.ResultName;
            return bl;
        }
    }



    public class ListItem
    {
        private string id = string.Empty;
        private string name = string.Empty;
        public ListItem(string sid, string sname)
        {
            id = sid;
            name = sname;
        }

        public override string ToString()
        {
            return this.name;
        }
        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }
        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }
    }
}
